<?php
/*
 *      index.php
 *      
 *      Copyright 2011 unro <unro.ua@gmail.com>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

include ("./inc/core.php");
SESSION();
$UserID = $_SESSION["userID"];
OpenConn();
$u_array = GetUserInfo($UserID);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Insomnium (iUnro) -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang=en lang=en>
<head>
	<base href="<?=$SERVERADDR?>/" />
	<title>Панель голосования</title>
	<link href=css/style.css rel=stylesheet type=text/css />
	<meta http-equiv="content-type" content="text/html;charset=utf8" /></head>
<body>
<br><br><br>
<div id=main>

<div class=acc_window>
<div class=acc_menu>
<table align=center>
<tr><td>Ваш IP-Адрес: <b><?php print $_SERVER['REMOTE_ADDR']?></b></tr></td>
<tr><td>Аккаунт: <b><?php print $u_array['username']?></b></tr></td>
<tr><td>Бонусов: <b><?php print $u_array['bonuses']?></b></tr></td>
<tr><td><input type=submit value="Выход" onclick="location.href='dologin.php?action=logout'">
<?php
if($_SESSION["admin"]==1)
{ echo "<input type=\"button\" value=\"Управление Панелью\" onclick=\"location.href='dologin.php?action=admin'\">"; }
?></tr></td></table></div></div>

<div id=login>
<div class=login_head></div>
<div class=login_body>
<center><b>Панель голосования сервера <?php print $servername ?></b></center>
<br>
<tr><td><table align=center>
<tr><td>ТОП</td><td>Голосование</td></tr>
<?php
	$serviseselect = mysql_query("SELECT * FROM `game_top`");
		if(mysql_num_rows($serviseselect) != 0)
			{while($rov = mysql_fetch_array($serviseselect)) {
	echo "<tr><td>".$rov['name']."</td><td>".CheckUserVote( $rov['id'], $UserID)."</td></tr>"; 
	}
		}
	else echo "<td colspan=2>Администрация еще не добавила ТОПы в список!</td>";		
			?>
	</table></td></tr></table></div><div class=login_foot></div></div></div>
</body></html>
